<!-- 
文件说明：该文件是“搜索”和“重置”按钮的公共组件；
-->
<template>
  <div>
    <a-form
      ref="formRef"
      name="advanced_search"
      class="ant-advanced-search-form"
      :model="searchParam"
    >
      <a-row :gutter="24">
        <slot name="searchItem" :formState="searchParam"></slot>
      </a-row>
      <a-row>
        <a-col :span="24" style="text-align: right">
          <!-- 搜索 -->
          <a-button type="primary" @click="search"> 搜索 </a-button>
          <!-- 重置 -->
          <a-button style="margin: 0 8px" @click="reset"> 重置 </a-button>
        </a-col>
      </a-row>
    </a-form>
  </div>
</template>

<script setup lang="ts">
/* 接口 */
interface SearchFormProps {
  searchParam?: { [key: string]: any }; // 搜索参数
  search: (params?: any) => void; // 搜索方法
  reset: (params: any) => void; // 重置方法
}
/* 默认值 */
withDefaults(defineProps<SearchFormProps>(), {
  searchParam: () => ({}),
});
</script>

<style scoped lang="scss"></style>
